package thread;

import java.util.Scanner;

public class Sleep {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入一个整数:");
        int num = scan.nextInt();
        try {
            for(int i=0;i<=num;i++) {
                System.out.println("倒计时:"+(num-i));
                Thread.sleep(1000);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }finally {
            System.out.println("倒计时结束");
        }
        System.out.println("程序结束了");
    }
}
